package entities;

import java.awt.Graphics2D;

/**
 *
 * @author casshern
 */
public class Asteroid extends GameObject {

    public Asteroid(int type, int x, int y, boolean alive) {
        this.playerID = 0;
        this.type = type;
        this.x = x;
        this.y = y;
        this.alive = alive;
        size = 40;
        maxHealth = 1500;
        currentHealth = maxHealth;
    }

    public Asteroid(int type, int x, int y, int currentHealth, boolean alive) {
        this.playerID = 0;
        this.type = type;
        this.x = x;
        this.y = y;
        this.currentHealth = currentHealth;
        this.alive = alive;
        size = 40;
        maxHealth = 1500;
    }

    @Override
    public void drawObject(Graphics2D g) {
        if (alive) {
            switch (type) {
                case GameObject.ASTEROID0:
                    ImageMemory.ASTEROID0.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID1:
                    ImageMemory.ASTEROID1.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID2:
                    ImageMemory.ASTEROID2.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID3:
                    ImageMemory.ASTEROID3.paintIcon(null, g, x, y);
                    break;
            }
        } else {
            switch (type) {
                case GameObject.ASTEROID0:
                    ImageMemory.ASTEROID0_DEAD.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID1:
                    ImageMemory.ASTEROID1_DEAD.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID2:
                    ImageMemory.ASTEROID2_DEAD.paintIcon(null, g, x, y);
                    break;
                case GameObject.ASTEROID3:
                    ImageMemory.ASTEROID3_DEAD.paintIcon(null, g, x, y);
                    break;
            }
        }
    }
}
